﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WWB.SitePointPrivateMessages.Web.Infrastructure
{
    public static class HtmlHelpers
    {
        public static string ReferenceScript(this HtmlHelper helper, string scriptName)
        {
            var path = VirtualPathUtility.ToAbsolute(string.Format("~/Scripts/{0}.js", scriptName));
            return string.Format("<script type=\"text/javascript\" src=\"{0}\" ></script>", path);
        }

        public static string ReferenceStylesheet(this HtmlHelper helper, string styleSheetName, string media)
        {
            return string.Format("<link rel=\"stylesheet\" href=\"{0}\" media=\"{1}\" />",
                                 VirtualPathUtility.ToAbsolute(string.Format("~/Content/{0}.css", styleSheetName)),
                                 media);
        }
    }
}